package com.example.template.study.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.example.template.core.annotation.MapperClass;
import com.example.template.core.entity.BaseEntity;
import com.example.template.study.mapper.StudentMapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 
 * 学生
 * @author meko
 * @date 2019-12-02
 */
@Data
@Accessors(chain = true)
@ApiModel("学生")
@MapperClass(StudentMapper.class)
@Table(name = "`student`")
public class Student extends BaseEntity {
    /**
     * ID
     */
    @Id
    @Column(name = "`id`")
    @GeneratedValue(generator = "JDBC")
    @ApiModelProperty("ID")
    @Excel(name = "ID")
    private Integer id;

    /**
     * 学号
     */
    @Column(name = "`number`")
    @ApiModelProperty("学号")
    @Excel(name = "学号")
    private String number;

    /**
     * 姓名
     */
    @Column(name = "`name`")
    @ApiModelProperty("姓名")
    @Excel(name = "姓名")
    private String name;

    /**
     * 年龄
     */
    @Column(name = "`age`")
    @ApiModelProperty("年龄")
    @Excel(name = "年龄")
    private Integer age;

    /**
     * 创建时间
     */
    @Column(name = "`create_time`")
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    @Excel(name = "创建时间")
    private Date createTime;

    /**
     *  性别
     */
    @Column(name = "`sex`")
    @ApiModelProperty(" 性别")
    @Excel(name = " 性别")
    private String sex;

    public static final String ID = "id";

    public static final String DB_ID = "id";

    public static final String NUMBER = "number";

    public static final String DB_NUMBER = "number";

    public static final String NAME = "name";

    public static final String DB_NAME = "name";

    public static final String AGE = "age";

    public static final String DB_AGE = "age";

    public static final String CREATE_TIME = "createTime";

    public static final String DB_CREATE_TIME = "create_time";

    public static final String SEX = "sex";

    public static final String DB_SEX = "sex";

    public static Student defaultInstance() {
        Student instance = new Student();
        return instance;
    }
}